package com.doitedu.day03.funcs

import scala.io.Source

/**
 * @Date 22.6.23
 * @Created by HANGGE
 * @Description
 */
object Test {
  def main(args: Array[String]): Unit = {
    Source
     .fromFile("E://words.txt")
     .getLines()
     .flatMap(_.split("\\s+"))
     .toList
     .groupBy(e => e)
     .mapValues(_.size)
     .toList
     .sortBy(-_._2)
     .foreach(println)

  }

}
